﻿-- =====================================================
-- Author:			Saghari, Farid
-- Create date:		1390/01/26
-- Description:     Fetch banks by condition
-- =====================================================
CREATE PROCEDURE [uspBankFetchCondition]
	@condition nvarchar(500)
AS
BEGIN
	DECLARE @query nvarchar(2000)
	SET @query = 'SELECT [Bank].[BankID],[Bank].[BankName] 
	FROM [Bank]'
	IF @Condition IS NOT NULL
		IF @Condition <> ''
			SET @query = @query + ' WHERE ' + @condition
	EXEC(@query)
END